package com.yht.weblog.web.service.impl;

import com.yht.weblog.common.domain.dos.BlogSettingsDO;
import com.yht.weblog.common.domain.mapper.BlogSettingsMapper;
import com.yht.weblog.common.utils.Response;
import com.yht.weblog.web.convert.BlogSettingsConvert;
import com.yht.weblog.web.model.vo.blogsettings.FindBlogSettingsRspVO;
import com.yht.weblog.web.service.BlogSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: yht
 * @date: 2024/1/12 23:15
 * @description:
 **/
@Service
public class BlogSettingsServiceImpl implements BlogSettingsService {

    @Autowired
    private BlogSettingsMapper blogSettingsMapper;

    /**
     * 前台获取博客设置
     * @return
     */
    @Override
    public Response findDetail() {
        // 根据ID获取博客设置DO对象
        BlogSettingsDO blogSettingsDO = blogSettingsMapper.selectById(1);

        // 将博客设置DO对象转换为博客设置响应VO对象
        FindBlogSettingsRspVO findBlogSettingsRspVO = BlogSettingsConvert.INSTANCE.convertDO2VO(blogSettingsDO);

        // 返回成功的响应结果，包含博客设置响应VO对象
        return Response.success(findBlogSettingsRspVO);
    }

}
